package top.zy.service.zymallgoodsinterface.api;

import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import top.zy.common.zymallcommon.utils.constants.Constants;
import top.zy.common.zymallcommon.utils.exception.ZymalException;
import top.zy.service.zymallgoodsinterface.entity.SpecGroup;
import top.zy.service.zymallgoodsinterface.entity.SpecParam;
import top.zy.service.zymallgoodsinterface.entity.Specification;
import top.zy.service.zymallgoodsinterface.vo.SpecGroupVo;

import java.util.List;

/**
 * @Author: HouZeYu
 * @Description:
 * @Date: Created in 14:47 2019/7/2
 */
public interface SpecApi {
     /***
      * 根据分类id查询规格组信息
      * @param id
      * @return
      */
     @GetMapping("spec/groups/{id}")
      List<SpecGroup> querySpecGroupByCategoryId(@PathVariable("id") Long id);

     /**
      * 根据规格组信息查询 参数
      * @param gid
      * @param cid
      * @param searching
      * @return
      */
     @GetMapping("spec/params")
      List<SpecParam> queryParams(@RequestParam(value = "gid", required = false) Long gid,
                                        @RequestParam(value = "cid", required = false) Long cid,
                                        @RequestParam(value = "searching", required = false) Boolean searching);


    /***
     * 根据分类查询规格组信息和其包含的参数信息
     * @param cid
     * @return
     */
      @GetMapping("spec/group")
      List<SpecGroupVo> querySpecGroupAndParamByCid(@RequestParam("cid")Long cid);
}
